//
//  JieXiaoDetailBottomView.swift
//  HappyEat
//
//  Created by 张继强 on 17/1/23.
//  Copyright © 2017年 陌路是我. All rights reserved.
//

import UIKit
//height = 49
class JieXiaoDetailBottomView: UIView {
    var leftButton:UIButton = UIButton.init()
    var rightButton:UIButton = UIButton.init()
    override init(frame: CGRect) {
        super.init(frame: frame)
        self.setUI()
    }
    
    required init?(coder aDecoder: NSCoder) {
        super.init(coder: aDecoder)
    }
}
extension JieXiaoDetailBottomView{
    func setUI(){
        self.addSubview(self.leftButton)
        self.addSubview(self.rightButton)
        self.leftButton.setTitle("立即参与", for: .normal)
        self.leftButton.setTitleColor(.white, for: .normal)
        self.leftButton.backgroundColor = .red
        self.leftButton.layer.cornerRadius = 5
        let label:UILabel = UILabel.init()
        self.rightButton.setTitleColor(.red, for: .normal)
        self.rightButton.backgroundColor = .white
        self.rightButton.setTitle("全家兑换", for: .normal)
        self.rightButton.layer.borderWidth = 1.0
        self.rightButton.layer.borderColor = UIColor.red.cgColor
        self.rightButton.layer.cornerRadius = 5.0
        self.rightButton.snp.makeConstraints { (make) in
            make.right.equalTo(-16)
            make.height.equalTo(40)
            make.width.equalTo(label.width(forText: "全价兑换", withFontSize: 16, withTextHeight: 16)+20)
            make.top.equalTo(4.5)
        }
        self.leftButton.snp.makeConstraints { (make) in
            make.left.equalTo(16)
            make.right.equalTo(self.rightButton.snp.left).offset(-20)
            make.top.equalTo(self.rightButton)
            make.height.equalTo(40)
        }
        
    }
}
